<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
		</script>
		<script>
		$(document).ready(function(){
			$("登录").click(function(){
				alert("段落被点击。");
			});
		});
		</script>
	</head>
	<body>
		<from id="from" action="2.html" method="get">
			账号：<input id="txt_name" type="text" name="账号" />
			<br />
			密码：<input id="txt_pwsd" type="password" name="账号" />
			<br />
			<input id="btn_log" type="submit" value="登录" />
			<input id="btn_res" type="button" value="重置" />
		</from>
		
		<script type="text/javascript">
		$(function(){
			$("#btn_log").click(function(){
				var log=$("#txt_name").val();
				var pwsd=$("#txt_pwsd").val();
				if(log == "123" && pwsd == "123"){
					alert("欢迎"+"登录成功");
				}
				else if (log == ""&& pwsd == ""){
					alert("账户或密码不能为空！");
				}
				else{
					alert("账户或密码输入错误，请重新输入！");
					$("#txt_name").val();
					$("#txt_pwsd").val();
				}
			});
		});
		</script>
	</body>
</html>
